\(\int \frac {x}{5+2 x+x^2} \, dx\) [2255]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 12, antiderivative size = 26 \[ \int \frac {x}{5+2 x+x^2} \, dx=-\frac {1}{2} \arctan \left (\frac {1+x}{2}\right )+\frac {1}{2} \log \left (5+2 x+x^2\right ) \]

[Out]

-1/2*arctan(1/2+1/2*x)+1/2*ln(x^2+2*x+5)

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 26, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {648, 632, 210, 642} \[ \int \frac {x}{5+2 x+x^2} \, dx=\frac {1}{2} \log \left (x^2+2 x+5\right )-\frac {1}{2} \arctan \left (\frac {x+1}{2}\right ) \]

[In]

Int[x/(5 + 2*x + x^2),x]

[Out]

-1/2*ArcTan[(1 + x)/2] + Log[5 + 2*x + x^2]/2

Rule 210

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(-(Rt[-a, 2]*Rt[-b, 2])^(-1))*ArcTan[Rt[-b, 2]*(x/Rt[-a, 2])
], x] /; FreeQ[{a, b}, x] && PosQ[a/b] && (LtQ[a, 0] || LtQ[b, 0])

Rule 632

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Dist[-2, Subst[Int[1/Simp[b^2 - 4*a*c - x^2, x], x]
, x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 642

Int[((d_) + (e_.)*(x_))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Simp[d*(Log[RemoveContent[a + b*x +
c*x^2, x]]/b), x] /; FreeQ[{a, b, c, d, e}, x] && EqQ[2*c*d - b*e, 0]

Rule 648

Int[((d_.) + (e_.)*(x_))/((a_) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Dist[(2*c*d - b*e)/(2*c), Int[1/(a +
 b*x + c*x^2), x], x] + Dist[e/(2*c), Int[(b + 2*c*x)/(a + b*x + c*x^2), x], x] /; FreeQ[{a, b, c, d, e}, x] &
& NeQ[2*c*d - b*e, 0] && NeQ[b^2 - 4*a*c, 0] &&  !NiceSqrtQ[b^2 - 4*a*c]

Rubi steps \begin{align*} \text {integral}& = \frac {1}{2} \int \frac {2+2 x}{5+2 x+x^2} \, dx-\int \frac {1}{5+2 x+x^2} \, dx \\ & = \frac {1}{2} \log \left (5+2 x+x^2\right )+2 \text {Subst}\left (\int \frac {1}{-16-x^2} \, dx,x,2+2 x\right ) \\ & = -\frac {1}{2} \tan ^{-1}\left (\frac {1+x}{2}\right )+\frac {1}{2} \log \left (5+2 x+x^2\right ) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.00 (sec) , antiderivative size = 26, normalized size of antiderivative = 1.00 \[ \int \frac {x}{5+2 x+x^2} \, dx=-\frac {1}{2} \arctan \left (\frac {1+x}{2}\right )+\frac {1}{2} \log \left (5+2 x+x^2\right ) \]

[In]

Integrate[x/(5 + 2*x + x^2),x]

[Out]

-1/2*ArcTan[(1 + x)/2] + Log[5 + 2*x + x^2]/2

Maple [A] (verified)

Time = 0.31 (sec) , antiderivative size = 21, normalized size of antiderivative = 0.81

method result size
default \(-\frac {\arctan \left (\frac {1}{2}+\frac {x}{2}\right )}{2}+\frac {\ln \left (x^{2}+2 x +5\right )}{2}\) \(21\)
risch \(-\frac {\arctan \left (\frac {1}{2}+\frac {x}{2}\right )}{2}+\frac {\ln \left (x^{2}+2 x +5\right )}{2}\) \(21\)
parallelrisch \(\frac {\ln \left (x +1-2 i\right )}{2}+\frac {i \ln \left (x +1-2 i\right )}{4}+\frac {\ln \left (x +1+2 i\right )}{2}-\frac {i \ln \left (x +1+2 i\right )}{4}\) \(36\)

[In]

int(x/(x^2+2*x+5),x,method=_RETURNVERBOSE)

[Out]

-1/2*arctan(1/2+1/2*x)+1/2*ln(x^2+2*x+5)

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.77 \[ \int \frac {x}{5+2 x+x^2} \, dx=-\frac {1}{2} \, \arctan \left (\frac {1}{2} \, x + \frac {1}{2}\right ) + \frac {1}{2} \, \log \left (x^{2} + 2 \, x + 5\right ) \]

[In]

integrate(x/(x^2+2*x+5),x, algorithm="fricas")

[Out]

-1/2*arctan(1/2*x + 1/2) + 1/2*log(x^2 + 2*x + 5)

Sympy [A] (verification not implemented)

Time = 0.04 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.77 \[ \int \frac {x}{5+2 x+x^2} \, dx=\frac {\log {\left (x^{2} + 2 x + 5 \right )}}{2} - \frac {\operatorname {atan}{\left (\frac {x}{2} + \frac {1}{2} \right )}}{2} \]

[In]

integrate(x/(x**2+2*x+5),x)

[Out]

log(x**2 + 2*x + 5)/2 - atan(x/2 + 1/2)/2

Maxima [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.77 \[ \int \frac {x}{5+2 x+x^2} \, dx=-\frac {1}{2} \, \arctan \left (\frac {1}{2} \, x + \frac {1}{2}\right ) + \frac {1}{2} \, \log \left (x^{2} + 2 \, x + 5\right ) \]

[In]

integrate(x/(x^2+2*x+5),x, algorithm="maxima")

[Out]

-1/2*arctan(1/2*x + 1/2) + 1/2*log(x^2 + 2*x + 5)

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.77 \[ \int \frac {x}{5+2 x+x^2} \, dx=-\frac {1}{2} \, \arctan \left (\frac {1}{2} \, x + \frac {1}{2}\right ) + \frac {1}{2} \, \log \left (x^{2} + 2 \, x + 5\right ) \]

[In]

integrate(x/(x^2+2*x+5),x, algorithm="giac")

[Out]

-1/2*arctan(1/2*x + 1/2) + 1/2*log(x^2 + 2*x + 5)

Mupad [B] (verification not implemented)

Time = 0.04 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.77 \[ \int \frac {x}{5+2 x+x^2} \, dx=\frac {\ln \left (x^2+2\,x+5\right )}{2}-\frac {\mathrm {atan}\left (\frac {x}{2}+\frac {1}{2}\right )}{2} \]

[In]

int(x/(2*x + x^2 + 5),x)

[Out]

log(2*x + x^2 + 5)/2 - atan(x/2 + 1/2)/2